package com.eestimate.domain.impl;

import com.eestimate.dao.database.DBObject;
import com.eestimate.domain.Employee;
import com.eestimate.domain.business.BusinessObjectImpl;
import com.eestimate.domain.business.common.BusinessObjectTypeEnum;
import com.eestimate.domain.business.common.annotations.PersistentBusinessObject;
import com.eestimate.domain.business.common.annotations.PersistentMetadata;
import com.eestimate.valuesobjects.BaseDTO;
import com.eestimate.valuesobjects.EmployeeVo;

@PersistentBusinessObject(type=BusinessObjectTypeEnum.EMPLOYEE)
public class EmployeeImpl extends BusinessObjectImpl implements Employee{

	public EmployeeImpl(DBObject dbObject) {
		super(dbObject);
	}
	
	@PersistentMetadata
	public String firstName;
	
	@PersistentMetadata
	public String lastName;
	
	@PersistentMetadata
	public String email;
	
	@PersistentMetadata
	public String password;

	@PersistentMetadata
	public String phone;
	
	@PersistentMetadata
	public String companyUuid;

	@Override
	public String getFirstName() {
		return firstName;
	}

	@Override
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Override
	public String getLastName() {
		return lastName;
	}

	@Override
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Override
	public String getEmail() {
		return email;
	}

	@Override
	public void setEmail(String email) {
		this.email = email;
	}

	@Override
	public String getPassword() {
		return password;
	}

	@Override
	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public String getPhone() {
		return phone;
	}

	@Override
	public void setPhone(String phone) {
		this.phone = phone;
	}
		
	@Override
	public String getCompanyUuid() {
		return companyUuid;
	}

	@Override
	public void setCompanyUuid(String companyUuid) {
		this.companyUuid = companyUuid;
	}

	@Override
	public BaseDTO createDTO(){
		EmployeeVo vo = new EmployeeVo();
		vo.name = this.getName();
		vo.type = this.getType();
		vo.uuid = this.getUuid();
		
		vo.firstName 	= this.getFirstName();
		vo.lastName 	= this.getLastName();
		vo.email  		= this.getEmail();
		vo.phone		= this.getPhone();
		return vo;
	}
	
	
	
}
